/**
 * Copyright (C) 2008 aileron.cc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package cc.aileron.commons.logging;

/**
 * DebugType
 * @author Aileron
 *
 */
public enum LoggingLevel
{
	NONE(-1),
	ALL(0),
	CORE_DEBUG(5),
	DEBUG(10),
	INFO(20),
	WARN(30),
	ERROR(40),
	FATAL(50);
	
	/**
	 * devug level
	 */
	private final int level;
	
	/**
	 * debug level
	 * @param level
	 */
	private LoggingLevel(final int level)
	{
		this.level = level;
	}
	
	/**
	 * 比較
	 * @param logging
	 * @return
	 */
	public boolean compare(final LoggingLevel logging)
	{
		return this.level <= logging.level;
	}
	
	/**
	 * Logging するか如何か
	 * @return
	 */
	public boolean isLogging()
	{
		return this.level > NONE.level;
	}
}
